package day4;

public class Person {
    private String name;
    private int age;

    // 私有无参构造函数
    private Person() {
        this.name = "Default Name";
        this.age = 0;
        System.out.println("Private no-arg constructor called");
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    @Override
    public String toString() {
        return "Person{name='" + name + "', age=" + age + "}";
    }
}